<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="order/include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input type="hidden" th:value="${id}" id="juheOrderRefundId" name="juheOrderRefundId">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                拒绝原因：
                            </label>
                            <div class="col-sm-8">
                                <textarea maxlength="1000" rows="6" cols="100" id="content" name ="content" ></textarea>
                            </div>
                        </div>
                        <div class="form-group text-center">
                            <div class="col-sm-8 col-sm-offset-2">
                                <div class="btn btn-primary" onclick="edit()">
                                    <i class="fa fa-remove"></i> 提交
                                </div>
                                <div class="btn btn-danger" onclick="closeDow()">
                                    <i class="fa fa-remove"></i> 关闭
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="order/include::footer"></div>

<script type="text/javascript">
    //拒绝退款
    function edit() {
        $.ajax({
            cache : true,
            type : "get",
            url : "/order/manage/jhOrder/audit/fail",
            data : {
                juheOrderRefundId:$("#juheOrderRefundId").val(),
                content:$("#content").val()
            },
            async : false,
            error : function(request) {
                parent.layer.alert("Connection error");
            },
            success : function(data) {
                if (data.code == 0) {
                    parent.layer.msg("操作成功");
                    var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                    parent.layer.close(index);
                    var index2 = parent.parent.layer.getFrameIndex(window.name); // 获取窗口索引
                    parent.parent.layer.close(index2);
                    parent.parent.reLoad();
                } else {
                    if (data.msg) {
                        parent.layer.alert(data.msg)
                    }else {
                        window.location.href = "/";
                    }
                }

            }
        });
    }

    function closeDow() {
        var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
        parent.layer.close(index);
    }
</script>
</body>

</html>
